home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / examples / exam32 / main.c < prev    next >
C/C++ Source or Header  |  1995-09-27  |  1KB  |  83 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24.  
  25. #include "generics.h"
  26.  
  27.  
  28.  
  29. main(int argc, char *argv[])
  30. {
  31.     object    myObj;
  32.     gPrint_t    print_method;
  33.     int    i;
  34.  
  35.     InitDynace(&argc);
  36.  
  37.  
  38.     /*  Create an instance of the ShortInteger class */
  39.  
  40.     myObj = gNewWithInt(ShortInteger, 6);
  41.  
  42.     /*  perform the runtime overhead of finding the method once  */
  43.  
  44.     print_method = imiPointer(myObj, gPrint);
  45.  
  46.     for (i=0 ; i++ != 10 ; )
  47.  
  48.         /*  use it over and over without any lookup overhead  */
  49.         /*  Note that it's the same as:  gPrint(myObj, stdoutStream);*/
  50.  
  51.         print_method(myObj, stdoutStream);
  52.  
  53.  
  54.     gDispose(myObj);
  55.  
  56.     return 0;
  57. }
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. /*
  66.  *
  67.  *    This source code is CONFIDENTIAL and
  68.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  69.  *    distribution, adaptation or use    may
  70.  *    be subject to civil and    criminal penalties.
  71.  *
  72.  *    Copyright (c) 1993 Algorithms Corporation
  73.  *    3020 Liberty Hills Drive
  74.  *    Franklin, TN  37064
  75.  *
  76.  *    ALL RIGHTS RESERVED.
  77.  *
  78.  *
  79.  *
  80.  */
  81.  
  82.  
  83.